//
//  main.swift
//  swift练习
//
//  Created by mafeng on 16/7/8.
//  Copyright © 2016年 mafeng. All rights reserved.
//

import Foundation

var myVariable = 123
    myVariable = 321
// 常量
let a = 1
let b: Int = 2
let c = "\(a)"
let d = "\(a + b)"
print(d);

// 数组和字典
var shoppingList = ["catfish", "water"]
shoppingList[1] = "bottle of water"
print(shoppingList)

var occupationgs = ["Malcolo":"Captain", "Kayell":"Mechanin"]
occupationgs["Jayne"] = "Public Relations"
print(occupationgs)

// for循环
for index in 1...6{
    print("\(index) \(index * 6)")
}

let base = 3
let power = 10
var answer = 1
for _ in 1...power{    // _ 忽略的意思
    answer *= base
}
print("\(base) \(power) \(answer)")


